package t10086.Data.Map;

import java.io.Serializable;

public class TextCoordinate implements Serializable {
    public  int x;
    public  int y;
    public TextCoordinate() {}
    public TextCoordinate(int x, int y) {
        this.x = x;
        this.y = y;
    }
    public TextCoordinate(TextCoordinate coordinate) {
        if (coordinate == null) {
            System.out.println("NULL!!!! TextCoordinate");
            this.x =0;
            this.y =0;
            return;
        }
        this.x = coordinate.x;
        this.y = coordinate.y;
    }
    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    @Override
    public String toString() {
        return "TextCoordinate [x=" + x + ", y=" + y + "]";
    }
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof TextCoordinate) {
            TextCoordinate tc = (TextCoordinate) obj;
            return x == tc.x && y == tc.y;
        }
        return false;
    }
}
